package com.fragment.demo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import baidumapsdk.demo.R;

public class View1 extends Fragment{

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view=inflater.inflate(R.layout.show1, container, false);
		Button btn=(Button)view.findViewById(R.id.button1);
		btn.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
//				FragmentManager fm = getActivity().getSupportFragmentManager();
//				FragmentTransaction ft = fm.beginTransaction();
//				ft.replace(R.id.layout_mainview, new View2());
//				ft.addToBackStack(null);
//				ft.commit();
				
				Intent intent = new Intent(getActivity(), Test2Activity.class);
                startActivity(intent);
			}
		});
		return view;
	}

	@Override
	public void onPause() {
		super.onPause();
	}
	
}
